<%@ include file="/html/portlet/ext/dashBoard/init.jsp" %>

<liferay-portlet:renderURL var="dashBoardURL" windowState="<%= WindowState.NORMAL.toString() %>" >
	<portlet:param name="struts_action" value="/ext/dashBoard/dashBoardAction" />
	<portlet:param name="<%= Constants.CMD %>" value="degreeList" /> 
</liferay-portlet:renderURL>

<b><liferay-ui:message key="college_list" /> &raquo;</b><br><br>

<%  
	PortletURL navigationURL = renderResponse.createRenderURL();
	navigationURL.setParameter("struts_action", "/ext/dashBoard/dashBoardAction");
	navigationURL.setParameter(Constants.CMD, "collegeList-nav"); 
		
	List<College> collegeList = null;
	
	if(!permissionChecker.isOmniadmin()) {
	
		Long userId = themeDisplay.getUserId();
		collegeList = CollegeLocalServiceUtil.getByUserId(userId);
		
	} else {
	
		collegeList = CollegeLocalServiceUtil.getByStatus(1); 
	}
		
   	SearchContainer searchContainer = new SearchContainer(renderRequest, null, null, SearchContainer.DEFAULT_CUR_PARAM, 5, navigationURL, null, "");
	List<College> result = ListUtil.subList(collegeList, searchContainer.getStart(), searchContainer.getEnd());
	int total = collegeList.size();
	searchContainer.setTotal(total);	
		
   	for(int i=0; i < result.size(); i++) {
		College college = result.get(i);
%>
	<b><a href="<%= dashBoardURL.toString() %>&collegeId=<%= college.getCollegeId()%> "> <%= college.getName()%> &raquo;</a></b><br>
			
<%}%>

	<div class="taglib-search-iterator-page-iterator-bottom">
			<liferay-ui:search-paginator searchContainer="<%= searchContainer %>" />
	</div>

	<br>&laquo;<a href="javascript:history.go(-1)()"><liferay-ui:message key="back" /></a></b>